% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/latlon_from_s2b.R
\name{latlon_from_s2b}
\alias{latlon_from_s2b}
\title{DRAFT - Estimate lat,lon of site(s) from sites2blocks output of getblocksnearby()
trilateration -- Use lat,lon of nearby block points and distances to estimate original sitepoints}
\usage{
latlon_from_s2b(s2b)
}
\arguments{
\item{s2b}{sites2blocks data.table that is output of \code{\link[=getblocksnearby]{getblocksnearby()}}}
}
\value{
data.table with columns ejam_uniq_id, lat, lon, one row per site
}
\description{
DRAFT - Estimate lat,lon of site(s) from sites2blocks output of getblocksnearby()
trilateration -- Use lat,lon of nearby block points and distances to estimate original sitepoints
}
\details{
This function is needed ONLY if you did not retain site latlons,
and then only for sites not entirely in single states based on their nearby blocks.
This is slow and assumes you do not already know the lat,lon of the sitepoints.
If for some reason all you have is output of \code{\link[=getblocksnearby]{getblocksnearby()}} then this is how you could
estimate where the original sitepoint(s) were that were input(s) to \code{\link[=getblocksnearby]{getblocksnearby()}}

But ejamit() or the shiny app do not require doing this since the original latlon
of sitepoints are retained and provided to \code{\link[=doaggregate]{doaggregate()}}
which needs to figure out what state each site is in to use the right state percentiles.
}
\examples{
 pts = testpoints_10
 #x = latlon_from_s2b(getblocksnearby(pts, quiet = T))
 x = latlon_from_s2b(testoutput_getblocksnearby_10pts_1miles)
 cbind(estimate = x, pts, 
   latratio = x$lat/pts$lat, lonratio = x$lon/pts$lon)

}
\keyword{internal}
